package com.zf.lease.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zf.lease.mapper.RoomContractMapper;
import com.zf.lease.domain.RoomContract;
import com.zf.lease.service.IRoomContractService;

/**
 * 房间和契约关系Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-07
 */
@Service
public class RoomContractServiceImpl extends ServiceImpl<RoomContractMapper, RoomContract> implements IRoomContractService {
    @Autowired
    private RoomContractMapper roomContractMapper;

    /**
     * 查询房间和契约关系
     *
     * @param contractId 房间和契约关系主键
     * @return 房间和契约关系
     */
    @Override
    public RoomContract selectRoomContractByContractId(Long contractId) {
        return roomContractMapper.selectRoomContractByContractId(contractId);
    }

    /**
     * 查询房间和契约关系列表
     *
     * @param roomContract 房间和契约关系
     * @return 房间和契约关系
     */
    @Override
    public List<RoomContract> selectRoomContractList(RoomContract roomContract) {
        return roomContractMapper.selectRoomContractList(roomContract);
    }

    /**
     * 新增房间和契约关系
     *
     * @param roomContract 房间和契约关系
     * @return 结果
     */
    @Override
    public int insertRoomContract(RoomContract roomContract) {
            return roomContractMapper.insertRoomContract(roomContract);
    }

    /**
     * 修改房间和契约关系
     *
     * @param roomContract 房间和契约关系
     * @return 结果
     */
    @Override
    public int updateRoomContract(RoomContract roomContract) {
        return roomContractMapper.updateRoomContract(roomContract);
    }

    /**
     * 批量删除房间和契约关系
     *
     * @param contractIds 需要删除的房间和契约关系主键
     * @return 结果
     */
    @Override
    public int deleteRoomContractByContractIds(Long[] contractIds) {
        return roomContractMapper.deleteRoomContractByContractIds(contractIds);
    }

    /**
     * 删除房间和契约关系信息
     *
     * @param contractId 房间和契约关系主键
     * @return 结果
     */
    @Override
    public int deleteRoomContractByContractId(Long contractId) {
        return roomContractMapper.deleteRoomContractByContractId(contractId);
    }
}